import { __decorate } from "tslib";
import { observable, action } from 'mobx';
// import { createContext } from '@tarojs/taro'
class CounterStore {
  constructor() {
    this.counter = 0; // 例子
    this.tabList = []; // tabbar页面
    this.isInit = false; // 程序是否初始化成功
    this.initFail = false; // 程序是否初始化失败
    this.pageIsReady = false; // 页面是否加载成功
    this.isLogin = false; // 当前用户是否登录
    this.stopReq = false; // 是否阻止其它业务请求，当正在登录中的时候，其它接口都停止业务请求处理
    this.jwtToken = ''; // 用户令牌
    this.model = ''; // 终端型号
    this.pixelRatio = 3; // 几倍屏
    this.windowWidth = 0; // 终端宽度
    this.windowHeight = 0; // 终端高度
    this.isIphoneX = false; // 终端型号是否为iphoneX
    this.searchKey = ''; // 搜索热词
    this.fileCdn = 'https://jdc.jd.com/'; // 静态资源网域
  }
  increment() {
    this.counter++;
  }
  decrement() {
    this.counter--;
  }
  incrementAsync() {
    setTimeout(() => this.counter++, 1000);
  }
  setTabList(tabBar) {
    this.tabList = tabBar.list;
  }
}
__decorate([observable], CounterStore.prototype, "counter", undefined);
__decorate([observable], CounterStore.prototype, "tabList", undefined);
__decorate([observable], CounterStore.prototype, "isInit", undefined);
__decorate([observable], CounterStore.prototype, "initFail", undefined);
__decorate([observable], CounterStore.prototype, "pageIsReady", undefined);
__decorate([observable], CounterStore.prototype, "isLogin", undefined);
__decorate([observable], CounterStore.prototype, "stopReq", undefined);
__decorate([observable], CounterStore.prototype, "jwtToken", undefined);
__decorate([observable], CounterStore.prototype, "model", undefined);
__decorate([observable], CounterStore.prototype, "pixelRatio", undefined);
__decorate([observable], CounterStore.prototype, "windowWidth", undefined);
__decorate([observable], CounterStore.prototype, "windowHeight", undefined);
__decorate([observable], CounterStore.prototype, "isIphoneX", undefined);
__decorate([observable], CounterStore.prototype, "searchKey", undefined);
__decorate([observable], CounterStore.prototype, "fileCdn", undefined);
__decorate([action.bound], CounterStore.prototype, "increment", null);
__decorate([action.bound], CounterStore.prototype, "decrement", null);
__decorate([action.bound], CounterStore.prototype, "incrementAsync", null);
__decorate([action.bound], CounterStore.prototype, "setTabList", null);
// export default createContext(new CounterStore())
export default new CounterStore();